import { OtherKey } from '../common/Key';
cc.Class({
    extends: require('BasePanel'),

    properties: {
        WXSubContextView: cc.WXSubContextView,
    },

    onLoad() {
        this._super();
    },

    onEnter(args, action = true) {
        this._super(args, action);
        G.partner.postMessage(OtherKey.SHOW_FRIEND_RANK);
        if (cc.sys.browserType == cc.sys.BROWSER_TYPE_WECHAT_GAME) {
            this.scheduleOnce(() => {
                this.WXSubContextView.updateSubContextViewport();
            }, 0.3)
        }
    },

    onExit(args) {
        this._super(args);
    },

    buttonListener(button) {
        let name = button.node.name;
        if (name == 'btnClose') {
            this._onClose();
        }

    },
    // _onTouchStart() {
    // },

});
